<template>
  <div>
    <div style="display: flex;align-items: center;">
      <span>编号 :</span>
      <el-input
        style="width: 200px; margin: 0 0 0 0.5vw"
        v-model="queryForm.id"
        placeholder="请输入内容"
        size="small"
      ></el-input>
      <span style="margin: 0 0 0 1vw">采购标题 :</span>
      <el-input
        style="width: 200px; margin: 0 0 0 0.5vw"
        v-model="queryForm.title"
        placeholder="请输入内容"
        size="small"
      ></el-input>
      <span style="margin: 0 0 0 1vw">采购时间 :</span>
      <el-date-picker
        v-model="queryForm.buyDate"
        style="width: 200px; margin: 0 0 0 0.5vw"
        placeholder="选择日期时间"
        type="date"
        value-format="yyyy-MM-dd"
        format="yyyy-MM-dd"
        size="small"
      ></el-date-picker>
      <div style="margin: 0 0 0 10px">
        <el-button type="primary" size="small"  @click="query" >搜索</el-button>
        <el-button type="primary" size="small"  @click="add" >新增</el-button>
      </div>
    </div>
  </div>
</template>
  <script>
export default {
  data() {
    return {
      queryForm: {
        id: "", //编号
        title: "", //标题
        buyDate: "",
      },
    };
  },
  methods:{
    query(){
        //向上传query
        this.$emit('search',this.queryForm)
    },
    //新增
    add(){
      this.$router.push({
        path:'/purchase/add'
      })
    }
  }
};
</script>
  <style scoped>
</style>